/**
 * Project Name:kany-project-blog-web
 * File Name:CommonResource.java
 * Package Name:me.kany.project.blog.resource
 * Date:2016年9月23日上午9:34:27
 * Copyright (c) 2016, Jason.Wang All Rights Reserved.
 */
package me.kany.project.blog.resource;

import java.util.ArrayList;
import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;

/**
 * ClassName:CommonResource<br/>
 * Function: 公用的开放方法<br/>
 * Date:2016年9月23日上午9:34:27<br/>
 * 
 * @author Jason.Wang
 * @version 1.0
 * @since JDK1.7
 * @see
 */
@Path("/common")
@Component
public class CommonResource {
	
	@GET
	@Path("/user")
	@Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
	public JSONObject user(@PathParam("name") String name){
		JSONObject jsonObject = new JSONObject();
		List<String> list = new ArrayList<String>();
		for (int i = 0; i < 8; i++) {
			list.add("用户"+(i+1));
		}
		jsonObject.put("data", list);
		return jsonObject;
	}
}
